package com.dinzeer.pseudoedge_break_dawn.data;

import mods.flammpfeil.slashblade.init.SBItems;
import mods.flammpfeil.slashblade.recipe.RequestDefinition;
import mods.flammpfeil.slashblade.recipe.SlashBladeIngredient;
import mods.flammpfeil.slashblade.recipe.SlashBladeShapedRecipeBuilder;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.world.item.Items;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;

import java.util.function.Consumer;

public class PbdRecipe extends RecipeProvider implements IConditionBuilder {
    //合成表datagen
    public PbdRecipe(PackOutput output) {
        super(output);
    }
    protected void buildRecipes(Consumer<FinishedRecipe> consumer){

        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blade_diamond.location())
                .pattern(" A ")
                .pattern(" A ")
                .pattern(" BC")
                .define('A', Items.DIAMOND)
                .define('B',Items.STICK
                )
                .define('C', SBItems.proudsoul_tiny
                )
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blade_gold.location())
                .pattern(" A ")
                .pattern(" A ")
                .pattern(" BC")
                .define('A',Items.GOLD_INGOT)
                .define('B',Items.STICK)
                .define('C',SBItems.proudsoul_tiny)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blade_iron.location())
                .pattern(" A ")
                .pattern(" A ")
                .pattern(" BC")
                .define('A',Items.IRON_INGOT)
                .define('B',Items.STICK)
                .define('C',SBItems.proudsoul_tiny)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blade_stone.location())
                .pattern(" A ")
                .pattern(" A ")
                .pattern(" BC")
                .define('A',Items.STONE)
                .define('B',Items.STICK)
                .define('C',SBItems.proudsoul_tiny)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blade_wood.location())
                .pattern(" A ")
                .pattern(" A ")
                .pattern(" BC")
                .define('A',Items.OAK_PLANKS)
                .define('B',Items.STICK)
                .define('C',SBItems.proudsoul_tiny)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blade_netherite.location())
                .pattern("   ")
                .pattern(" A ")
                .pattern(" BC")
                .define('A',Items.NETHERITE_INGOT)
                .define('B',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(PbdBuiltInRegsitry.blade_diamond.location())

                                .build()
                ))
                .define('C',SBItems.proudsoul_tiny)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.xblades.location())
                .pattern("AAA")
                .pattern("BCB")
                .pattern("DEF")
                .define('A', Items.NETHER_STAR)
                .define('B', Items.NETHER_BRICK)
                .define('C',SlashBladeIngredient.of(
                        SBItems.slashblade,RequestDefinition.Builder.newInstance()
                                .killCount(100)
                                .proudSoul(20000)
                                .refineCount(10)

                                .build()
                ))
                .define('D',SBItems.proudsoul_ingot)
                .define('E',SBItems.proudsoul_sphere)
                .define('F',SBItems.proudsoul)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.whitesword.location())
                .pattern("ABC")
                .pattern("DEF")
                .pattern("DDG")
                .define('A', Items.NETHER_STAR)
                .define('B', Items.IRON_BLOCK)
                .define('C', Items.DIAMOND_BLOCK)
                .define('D',SBItems.proudsoul)
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(150)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.xblades.location())
                                .build()
                ))
                .define('F',Items.OBSIDIAN)
                .define('G',SBItems.proudsoul_sphere)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.magicblade.location())
                .pattern("ABB")
                .pattern("BCB")
                .pattern("DBE")
                .define('A', SBItems.proudsoul)
                .define('B', Items.NETHER_STAR)
                .define('C',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(100)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.xblades.location())
                                .build()
                ))
                .define('D', Items.OBSIDIAN)
                .define('E',SBItems.proudsoul_sphere)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.latent.location())
                .pattern("ABA")
                .pattern("ACA")
                .pattern("DEF")
                .define('A',  Items.NETHER_STAR)
                .define('B', Items.OBSIDIAN)
                .define('C',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(100)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.xblades.location())
                                .build()
                ))
                .define('D', Items.BLAZE_ROD)
                .define('E', Items.IRON_BLOCK)
                .define('F', Items.SPIDER_EYE)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.pseudosword.location())
                .pattern("ABC")
                .pattern("DEC")
                .pattern("FBC")
                .define('A',  SBItems.proudsoul_sphere)
                .define('B', Items.NETHER_STAR)
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(200)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.xblades.location())
                                .build()
                ))
                .define('C',  SBItems.proudsoul)
                .define('D', Items.DIAMOND_BLOCK)
                .define('F', Items.OBSIDIAN)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.dragonblade.location())
                .pattern("ABC")
                .pattern("DEF")
                .pattern("BGB")
                .define('A',  Items.DRAGON_EGG)
                .define('B', Items.NETHER_STAR)
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(200)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.xblades.location())
                                .build()
                ))
                .define('C',  Items.GLOWSTONE)
                .define('D', Items.OBSIDIAN)
                .define('F', Items.IRON_BLOCK)
                .define('G', Items.END_STONE)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);


        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.purplesblade.location())
                .pattern("ABC")
                .pattern("BC ")
                .pattern("DE ")
                .define('A',  Items.OBSIDIAN)
                .define('B', SBItems.proudsoul_sphere)
                .define('C', SBItems.proudsoul_ingot)
                .define('D', SBItems.slashblade)
                .define('E', Items.STRING)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.dimension.location())
                .pattern("AAA")
                .pattern("B B")
                .pattern("CAD")
                .define('A',  Items.DIAMOND_BLOCK)
                .define('B', Items.NETHER_STAR)
                .define('C', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(200)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.xblades.location())
                                .build()
                ))
                .define('D',  SBItems.proudsoul_sphere)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.kumasakura.location())
                .pattern("ABC")
                .pattern("DEF")
                .pattern("GHI")
                .define('A',  Items.DIAMOND_BLOCK)
                .define('B', Items.OAK_LEAVES)
                .define('C', Items.IRON_BLOCK)
                .define('D', Items.EMERALD)
                .define('E', SBItems.slashblade_wood)
                .define('F', Items.DIAMOND)
                .define('G', Items.IRON_INGOT)
                .define('H', Items.NETHER_STAR)
                .define('I', Items.EMERALD_BLOCK)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.kingblade.location())
                .pattern("AAA")
                .pattern("BCB")
                .pattern("AAA")
                .define('A',  Items.DIAMOND_BLOCK)
                .define('B', Items.OBSIDIAN)
                .define('C', SBItems.slashblade)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.vitex.location())
                .pattern("ABC")
                .pattern("BDB")
                .pattern("CBC")
                .define('A',  Items.OBSIDIAN)
                .define('B', Items.CACTUS)
                .define('C', Items.NETHER_STAR)
                .define('D',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(300)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.purplesblade.location())
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(PbdBuiltInRegsitry.blackpixie.location())
                .pattern("AAA")
                .pattern("BCB")
                .pattern("AAA")
                .define('A',  Items.DIAMOND_BLOCK)
                .define('C', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .killCount(300)
                                .proudSoul(20000)
                                .refineCount(10)
                                .name(PbdBuiltInRegsitry.pseudosword .location())
                                .build()
                ))
                .define('B', Items.NETHER_STAR)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
    }









}
